import operate from '@dfeidao/atom-nodejs/db/operate';
import { productid ,systemid} from '../../atom/config';
// 这里是修改的保存
interface Message {
	filter: {
		staff_no: string ,
		cabinet_staff_no: string,
		staff_name: string,
		contact_number: string,
		staff_nation: string,
		sex: string,
		staff_state: string,
		education: string,
		marital_status: string,
		native_place: string,
		politics_face: string,
		family_address: string
	};
}
export default async function atom(message: Message, action_id: string, session_id: string) {
	const { exec, update } = operate(action_id, session_id, systemid);
		// 修改数据
		update('department_staff', { productid,staff_no:message.filter.staff_no}, {
		staff_no:message.filter.staff_no,
		cabinet_staff_no:message.filter.cabinet_staff_no,
		staff_name:message.filter.staff_name,
		contact_number:message.filter.contact_number,
		staff_nation:message.filter.staff_nation,
		sex:message.filter.sex,
		staff_state:message.filter.staff_state,
		education:message.filter.education,
		marital_status:message.filter.marital_status,
		native_place:message.filter.native_place,
		politics_face:message.filter.politics_face,
		family_address:message.filter.family_address
	});
	const dt = await exec();
	return dt;
}
